﻿using System;
using System.Linq;
using FluentValidation;

namespace LINQPad.OpenAccess.UI.ViewModel.Validators
{
    /// <summary>
    ///   <see cref="CustomConnectionSettingsViewModel" /> validator.
    /// </summary>
    public class CustomConnectionSettingsViewModelValidator : ConnectionSettingsViewModelValidator<CustomConnectionSettingsViewModel>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="CustomConnectionSettingsViewModelValidator" /> class.
        /// </summary>
        public CustomConnectionSettingsViewModelValidator( )
        {
            this.RuleFor( e => e.ConnectionString )
                .NotEmpty( )
                .WithMessage( "connection string not set !" );
        }
    }
}
